Welcome to Preparatory Labs for Databases
1 Course Overview
1.1 Course Description
This SQL Bootcamp is designed to teach students, particularly those in applied business analytics and data science, the foundations and advanced techniques of SQL using both MySQL and PostgreSQL. Over nine modules, you will master fundamental SQL concepts such as querying data, working with joins, stored procedures, transactions, and more. Each module is accompanied by self-guided learning tasks, quizzes, and practical assessments to ensure a deep understanding of database concepts.
1.2 Learning Outcomes
Upon completing the SQL Bootcamp, you will be able to:
- Understand and write basic SQL queries.
- Retrieve, manipulate, and manage data efficiently.
- Work with multiple tables using joins and set operations.
- Create and manage databases, tables, and indexes.
- Understand and implement stored procedures, functions, triggers, and transactions.
1.3 Total Time Required
- Instructor-led learning: 2 hours (each module for 20 minutes)
- Self-guided learning and assessments: 4 hours combined
2 SQL Course Outline
2.1 Getting Started with SQL
- Objectives:
- Introduction to relational databases, setting up MySQL and PostgreSQL, understanding SQL syntax and data types.
- Lectures:
- Introduction to MySQL and PostgreSQL: Overview of popular relational databases and setting up local environments.
- Data Types: Understanding core SQL data types (e.g.,
int,varchar,date, etc.). - Creating Databases and Tables: Steps to create a new database and define tables.
- Inserting, Updating, and Deleting Records: Basic SQL operations for manipulating records.
2.2 Retrieving Data with SQL
- Objectives:
- Learn to write SQL queries to retrieve data from a database.
- Lectures:
- SELECT Statements: Introduction to the
SELECTstatement for querying data. - WHERE Clauses and Filtering Data: Using
WHEREto filter query results based on conditions. - Sorting Data with ORDER BY, LIMIT, and OFFSET: Techniques for ordering and limiting results.
- Using Variables in Queries: Working with variables to enhance query flexibility.
- SELECT Statements: Introduction to the
2.3 Modifying Data with SQL
- Objectives:
- Master techniques for modifying data in SQL databases.
- Lectures:
- INSERT, UPDATE, DELETE Statements: Essential commands for data manipulation.
- Error Handling and Constraints: Handling constraints like
PRIMARY KEYandFOREIGN KEY, and error management. - Managing NULL Values and Default Values: Handling missing or default values in SQL.
- String Operations in SQL: Useful string functions like
CONCAT,SUBSTRING, etc.
2.4 Joins and Advanced Queries
- Objectives:
- Learn to retrieve and work with data across multiple tables using SQL joins.
- Lectures:
- INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN: Understanding different types of joins and their uses.
- UNION and UNION ALL: Combining results from multiple queries.
- Grouping and Aggregating Data with GROUP BY: Techniques for grouping data and using aggregate functions like
SUM,COUNT, etc. - HAVING Clauses: Filtering aggregated data with
HAVING.
2.5 Managing Database Structures
- Objectives:
- Learn to modify and optimize database structures for improved performance.
- Lectures:
- ALTER TABLE and MODIFY Operations: Altering table structures and modifying columns.
- Creating and Deleting Indexes: Indexing strategies for faster data retrieval.
- Optimizing Queries for Performance: Techniques to improve query execution times.
- Handling Large Datasets and Backups: Managing large datasets, backups, and recovery
2.6 Stored Procedures and Triggers
- Objectives:
- Introduction to automation and server-side programming with stored procedures and triggers.e
- Lectures:
- Creating and Calling Stored Procedures: Writing reusable procedures for SQL operations.
- Creating and Managing Triggers: Automating actions with database triggers.
- Error Handling in Stored Procedures: Managing errors within stored procedures.
- Performance Considerations: Best practices for efficient stored procedures and triggers.